/* 本地PVP模式样式 */

.game-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 游戏头部信息 */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px 30px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    border-radius: 10px;
    min-width: 200px;
}

.player1-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.player2-info {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa8a8 100%);
    color: white;
}

.player-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.player-name {
    font-weight: bold;
    font-size: 16px;
}

.player-score {
    font-size: 18px;
    font-weight: bold;
}

.game-timer {
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 10px;
    color: white;
}

.timer-label {
    font-size: 14px;
    opacity: 0.8;
}

.timer-display {
    font-size: 24px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

/* 游戏区域 */
.game-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#gameCanvas {
    border: 3px solid #fff;
    border-radius: 15px;
    background: #1a1a2e;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* 游戏控制按钮 */
.game-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.game-controls .btn {
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    border: none;
    transition: all 0.3s ease;
    min-width: 120px;
}

.game-controls .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 游戏覆盖层 */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.overlay-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.overlay-content h2 {
    color: #333;
    margin-bottom: 10px;
}

.overlay-content p {
    color: #666;
    margin-bottom: 30px;
}

/* 操作说明区域 */
.instruction-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.instruction-section h5 {
    color: #495057;
    margin-bottom: 15px;
}

.control-info {
    text-align: center;
}

.control-info h6 {
    margin-bottom: 15px;
}

.keyboard-layout {
    display: inline-block;
    text-align: center;
}

.key-row {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 5px;
}

.key {
    width: 40px;
    height: 40px;
    background: #6c757d;
    color: white;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.key-w, .key-up {
    background: #28a745;
}

.key-a, .key-left {
    background: #dc3545;
}

.key-s, .key-down {
    background: #ffc107;
    color: #212529;
}

.key-d, .key-right {
    background: #17a2b8;
}

.key-space {
    width: 100px;
    background: #6f42c1;
    margin: 0 auto;
}

.key-description {
    font-size: 12px;
    color: #6c757d;
    margin-left: 10px;
}

.common-controls {
    text-align: center;
}

/* 规则说明 */
.rules-section {
    background: #e9ecef;
    padding: 20px;
    border-radius: 10px;
}

.rules-section h5 {
    color: #495057;
    margin-bottom: 15px;
}

.rules-list {
    text-align: left;
    color: #495057;
    margin: 0;
    padding-left: 20px;
}

.rules-list li {
    margin-bottom: 8px;
}

/* 游戏结果弹窗 */
.game-result {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.game-result.hidden {
    display: none;
}

.result-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.result-content h2 {
    color: #333;
    margin-bottom: 30px;
}

.result-stats {
    margin-bottom: 30px;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.winner-stat {
    background: #fff3cd;
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
    border: 2px solid #ffc107;
}

.stat-label {
    font-weight: bold;
    color: #495057;
}

.stat-value {
    font-weight: bold;
    color: #007bff;
}

.winner-stat .stat-value {
    color: #28a745;
    font-size: 18px;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.result-actions .btn {
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: bold;
    min-width: 140px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .player-info {
        min-width: auto;
        width: 100%;
        justify-content: center;
    }
    
    .game-controls {
        flex-wrap: wrap;
    }
    
    .overlay-content {
        padding: 20px;
        margin: 20px;
    }
    
    .result-actions {
        flex-direction: column;
    }
}

/* 防止方向键滚动 */
body {
    overflow: hidden;
}

/* 按钮悬停效果 */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* 游戏状态提示 */
.game-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 24px;
    font-weight: bold;
    display: none;
}

.game-status.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}